/*
 * @(#)Role.java 2009-2-19
 * Copyright (c) 2008-2015 by CJK
 * All rights reserved.
 */
package net.beyond.core.entity;

import java.util.HashSet;
import java.util.Set;

import net.beyond.common.BaseEntity;

/**
 * ��ɫ
 * 
 * @author Shmiluyu
 * @version 1.000 2009-2-19
 */
public class Role extends BaseEntity {

	private static final long serialVersionUID = 1L;
	// ��ɫ���
	private String roleName;
	// ӵ�е���Դ���
	private Set<Resource> resources;

	public String getRoleName() {
		return roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	public Set<Resource> getResources() {
		return resources;
	}

	public void setResources(Set<Resource> resources) {
		this.resources = resources;
	}

	public Role addResource(Resource res) {
		if (getResources() == null) {
			setResources(new HashSet<Resource>());
		}
		getResources().add(res);
		return this;
	}
}
